package com.solo.codegen.service.impl;

import com.solo.codegen.api.entity.GenModule;
import com.solo.codegen.mapper.GenModuleMapper;
import com.solo.codegen.service.GenModuleService;
import com.solo.codegen.service.inner.ModuleEngine;
import com.solo.common.core.base.service.impl.BasicServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 模块 Service实现类
 * @author 十一
 * @since 2024-10-18 15:41
 * 人生若只如初见，何事秋风悲画扇
 **/
@Service
@RequiredArgsConstructor
public class GenModuleServiceImpl extends BasicServiceImpl<GenModuleMapper, GenModule> implements GenModuleService {

    private final ModuleEngine moduleEngine;
    
    
    @Override
    public Map<String, String> generationCodes(Long moduleId) {
        GenModule module = mapper.selectOneById(moduleId);
        return moduleEngine.execute(module);
    }

}
